package com.bdqn.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 抛出的异常信息对象
 */
@Data
public class BaseException extends RuntimeException {
    private static final long serialVersionUID = 6197112078329713976L;
    //返回枚举信息
    private ResultEnum resultEnum;
    //错误码
    private Integer errorCode;
    //错误信息
    private String errorMessage;

     private  String msg;
    public BaseException(String msg) {
        this.msg=msg;
    }

    public BaseException(ResultEnum resultEnum) {
        this.resultEnum = resultEnum;
        this.errorCode = resultEnum.getCode();
        this.errorMessage = resultEnum.getMsg();
    }
}
